<?php /* Smarty version Smarty-3.1.6, created on 2013-05-02 17:24:56
         compiled from "../admin/Tpl\Flow\flow.tpl" */ ?>
<?php /*%%SmartyHeaderCode:15890518230e878e638-68404597%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'cd34fdc89e223b7323ea34bfbf79e7bf9e3ccc79' => 
    array (
      0 => '../admin/Tpl\\Flow\\flow.tpl',
      1 => 1365400702,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '15890518230e878e638-68404597',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'menu' => 0,
    'item' => 0,
    'row' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.6',
  'unifunc' => 'content_518230e886aa7',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_518230e886aa7')) {function content_518230e886aa7($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ("header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

<script type="text/javascript">
function selectAll(obj,id){
	if(obj.checked){
		$("#"+id).find("input[type=checkbox]").attr('checked',true);
	}else{
		$("#"+id).find("input[type=checkbox]").attr('checked',false);
	}
	
}
function selectParent(id) {
	var selected = $("#"+id).find("input[id^='sub_'][type='checkbox'][checked!='false']").length;
	if(selected>0){
		$("#parent_"+id).attr('checked',true);
	}else{
		$("#parent_"+id).attr('checked',false);
	}
	
}
</script>

<div class="title"> 确定项目中哪些模块可用，勾选后在角色管理中可见。</div>
<form method="POST" action="<?php echo U('Admin/updateNode');?>
">
<div class="div_main">  
    <?php  $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['item']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['menu']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value){
$_smarty_tpl->tpl_vars['item']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['item']->key;
?>
	    <div class="div_role_operate" id="<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
">
	        <div class="div_role_span"><?php echo $_smarty_tpl->tpl_vars['item']->value['title'];?>
<input id="parent_<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
" type="checkbox" onclick="selectAll(this,'<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
')" <?php if ($_smarty_tpl->tpl_vars['item']->value['status']==1){?>checked<?php }?>></div>
		    <?php  $_smarty_tpl->tpl_vars['row'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['row']->_loop = false;
 $_smarty_tpl->tpl_vars['sub_caption'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['item']->value['sub']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['row']->key => $_smarty_tpl->tpl_vars['row']->value){
$_smarty_tpl->tpl_vars['row']->_loop = true;
 $_smarty_tpl->tpl_vars['sub_caption']->value = $_smarty_tpl->tpl_vars['row']->key;
?>
		    <ul class="role_add">
		        <li><?php echo $_smarty_tpl->tpl_vars['row']->value['title'];?>
 <input name="flow[<?php echo $_smarty_tpl->tpl_vars['row']->value['id'];?>
]" id="sub_<?php echo $_smarty_tpl->tpl_vars['row']->value['id'];?>
" type="checkbox" value="1" onclick="selectParent(<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
)" <?php if ($_smarty_tpl->tpl_vars['row']->value['status']==1){?>checked<?php }?>></li>
		    </ul>
			<?php } ?>
		</div>
	<?php } ?>
	</div>
	<div style="width:600px;padding:20px;">
	<div class="impBtn fLeft"><input type="submit" value="保存" class="save imgButton"></div>
	<div class="impBtn fRig"><input type="reset" class="reset imgButton" value="清空" ></div>
	</div>
</form>
<?php echo $_smarty_tpl->getSubTemplate ("footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>
<?php }} ?>